﻿using OPM.Models.BaseModel;
using OPM.ServiceMember;

namespace OPM.Class
{
    public static class WSM
    {
        #region Member
        public static string Activate(string member_id, string member_code)
        {
            var s = new MemberSoapClient();
            var resultStr = s.Activate(member_id, member_code);
            return resultStr;
        }

        public static string ActivateByCode(string email, string activate_code)
        {
            var s = new MemberSoapClient();
            var resultStr = s.ActivateByCode(email, activate_code);
            return resultStr;
        }

        public static string ChangePassword(string old_password, string new_password)
        {
            var s = new MemberSoapClient();
            var resultStr = s.ChangePassword(U.Token, old_password, new_password);
            return resultStr;
        }

        public static string CheckEmail(string email)
        {
            var s = new MemberSoapClient();
            var resultStr = s.CheckEmail(email);
            return resultStr;
        }

        public static string CheckOtherName(string other_name)
        {
            var s = new MemberSoapClient();
            var resultStr = s.CheckOtherName(other_name);
            return resultStr;
        }

        public static string GetAllProfile()
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetAllProfile(U.Token);
            return resultStr;
        }

        public static string GetAttachment(string attachment_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetAttachment(U.Token, attachment_id);
            return resultStr;
        }

        public static string GetCase(string case_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetCase(U.Token, case_id);
            return resultStr;
        }

        public static string GetCaseAttachments(string attachment_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetAttachment(U.Token, attachment_id);
            return resultStr;
        }

        public static string GetCases(string case_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetCase(U.Token, case_id);
            return resultStr;
        }

        public static string GetContentDetail(string content_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetContentDetail(U.Token, content_id);
            return resultStr;
        }

        public static string GetContentHeaders(int? skip = null, int? take = null)
        {
            if (!skip.HasValue) skip = 0;
            if (!take.HasValue) take = U.RowPerPage;
            var s = new MemberSoapClient();
            var resultStr = s.GetContentHeaders(U.Token, skip.Value, take.Value);
            return resultStr;
        }

        public static string GetLastPassword()
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetLastPassword(U.Token);
            return resultStr;
        }

        public static string GetPictureProfile()
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetPictureProfile(U.Token);
            return resultStr;
        }

        public static string GetProfile()
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetProfile(U.Token);
            return resultStr;
        }

        public static string GetState()
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetState(U.Token);
            return resultStr;
        }

        public static string GetToken(string email, string password, AuthenForm authen_from, string ip_address)
        {
            var s = new MemberSoapClient();
            var resultStr = s.GetToken(email, password, authen_from.ToString(), ip_address);
            return resultStr;
        }

        public static string InformAttachment(string case_id, string file_name, string file_content,
            string file_description)
        {
            var s = new MemberSoapClient();
            var resultStr = s.InformAttachment(U.Token, case_id, file_name, file_content, file_description);
            return resultStr;
        }

        public static string InformCase(string objective_id, string type_id, string date_opened,
            string channel_incoming_id,
            string call_back, string channel_outgoing_id, string summary, string date_occurrenced,
            string country_id, string case_area,
            string subdistrict_id, string district_id, string province_id, string postcode, string latitude,
            string longitude,
            string case_value, string is_secret, string used_inform_with, string defendent, string is_incourt, string contact_secret,
            string is_victim, string cust_type,
            string cust_firstname,
            string cust_lastname, string cust_citizen_id, string cust_contact_detail, string cust_country_id,
            string cust_number, string cust_address, string cust_subdistrict_id, string cust_district_id,
            string cust_province_id,
            string cust_postcode, string cust_is_public)
        {
            var s = new MemberSoapClient();
            var resultStr = s.InformCase(U.Token, objective_id, type_id, date_opened, channel_incoming_id,
                call_back, channel_outgoing_id, summary, date_occurrenced, country_id, case_area,
                subdistrict_id, district_id, province_id, postcode, latitude, longitude,
                case_value, is_secret, used_inform_with, defendent, is_incourt, contact_secret, is_victim, cust_type, cust_firstname,
                cust_lastname, cust_citizen_id, cust_contact_detail, cust_country_id,
                cust_number, cust_address, cust_subdistrict_id, cust_district_id, cust_province_id,
                cust_postcode, cust_is_public);
            return resultStr;
        }

        public static string RecoveryPassword(string email, string citizen_id)
        {
            var s = new MemberSoapClient();
            var resultStr = s.RecoveryPassword(email, citizen_id);
            return resultStr;
        }

        public static string Register(string email, string firstname, string lastname, string citizen_id,
            string password, string country_id, string gender_id,
            string default_language)
        {
            var s = new MemberSoapClient();
            var resultStr = s.Register(email, firstname, lastname, citizen_id, password, country_id, gender_id,
                default_language);
            return resultStr;
        }

        public static string ReleaseToken()
        {
            var s = new MemberSoapClient();
            var resultStr = s.ReleaseToken(U.Token);
            return resultStr;
        }

        public static string SetPictureProfile(string picture_name, string data_url)
        {
            var s = new MemberSoapClient();
            var resultStr = s.SetPictureProfile(U.Token, picture_name, data_url);
            return resultStr;
        }

        public static string UpdateProfile(string salutation_th, string firstname_th,
            string lastname_th,
            string salutation_en, string firstname_en, string lastname_en, string other_name, string gender_id,
            string citizen_id, string country_id, string birthday, string address, string subdistrict_id,
            string district_id, string province_id, string postcode, string mobile,
            string phone, string remark, string default_language)
        {
            var s = new MemberSoapClient();
            var resultStr = s.UpdateProfile(U.Token, salutation_th, firstname_th, lastname_th,
                salutation_en, firstname_en, lastname_en, other_name, gender_id,
                citizen_id, country_id, birthday, address, subdistrict_id,
                district_id, province_id, postcode, mobile,
                phone, remark, default_language);
            return resultStr;
        }

        #endregion

    }
}